package difactroy

import (
	"gitee.com/ichub/goconfig/common/base/basedto"
	"go/ast"
)

type FileInfoDto struct {
	basedto.BaseEntity
	PathFile      string                 `json:"path_file,omitempty"`
	FileContent   string                 `json:"content,omitempty"`
	StructInfoMap map[string]*StructInfo `json:"struct_info_map,omitempty"`
	StructInfos   []*StructInfo
	Funcs         []string  `json:"funcs"`
	Node          *ast.File `json:"-"`
}

func NewFileInfoDto() *FileInfoDto {
	var fi = &FileInfoDto{
		StructInfoMap: make(map[string]*StructInfo),
		Funcs:         make([]string, 0),
		StructInfos:   make([]*StructInfo, 0),
	}
	fi.InitProxy(fi)
	return fi
}
func (this *FileInfoDto) ExistNewFunc(Struname string) bool {
	for _, v := range this.Funcs {
		if v == "New"+Struname {
			return true
		}
	}
	return false
}

//type TypeInfo struct {
//	Name string
//	Type string
//}
//
//
//func (this *TypeInfo) Filter(typename string) {
//
//}
